﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Activities;
using System.Collections.Generic;
using T2.WebSecurity.Business;
using T2.WebSecurity.Business.Workflows;
using System.Web.Security;

namespace T2.WebSecurity.Test
{
    [TestClass]
    public class UserProfile_Test
    {
        private readonly IBusinessService bs = null;

        
        public UserProfile_Test()
        {
            bs = new BusinessService();
        }

        

        [TestMethod]
        public void TestUserProfileCreateWF()
        {
            string _userName = "dff";
            string _password = "fas";

            IDictionary<string, object> input = new Dictionary<string, object>();
            input.Add("BusinessService", bs);
            input.Add("UserName", _userName);
            input.Add("Password", _password);
            IDictionary<string, object> output = WorkflowInvoker.Invoke(new UserProfileCreateCheckActivity(), input);
            if (output != null)
                if (output.ContainsKey("CheckStatus"))
                {
                    MembershipCreateStatus status = (MembershipCreateStatus)output["CheckStatus"];

                    Assert.AreEqual(status, MembershipCreateStatus.Success);
                    
                }
        }

        
    }
}
